'use strict';
const requireEx=require('yi-require');
const $ = requireEx('yi-schema');
module.exports = {

  query: $.object({
    page: $.object({
      size: $.number().integer().positive().default(10),
      index: $.number().integer().positive().default(1)
    }),
    filter: $.object({
      _id:[$.object({"$in":$.array().items($.mongoid())}).description("_id"),$.mongoid()],
      goodsId:$.mongoid().description('商品id'),
      storeId:$.mongoid().description('商铺id'),
      quantity:[$.number().description('库存数量'),
                $.object({
                  $gte:$.number(),
                  $lte:$.number()
                })],
      batchNumber:$.string().description('批次号'),
      comments:$.string().description('备注')
    }),
    project: $.object({
      _id:$.number().valid(0,1),
      name:$.number().valid(0, 1),
      storeId: $.number().valid(0, 1)
    }),
    sort: $.object({
      _id:$.number().valid(-1,1),
      name:$.number().valid(-1, 1),
      createTime: $.number().valid(-1, 1)
    })
  })
};
